package com.ruoyi.vehicle.service;


import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

@AiService(
       wiringMode = AiServiceWiringMode.EXPLICIT, // 手动注入
       chatModel = "OpenAiChatModel",   // 注入的chat模型
       streamingChatModel = "OpenAiStreamingChatModel",
       chatMemory = "chatMemory",
       chatMemoryProvider = "chatMemoryProvider"

)

//@AiService
public interface AiChatService {



    @SystemMessage(fromResource = "system.txt")//
    //用于聊天的方法             传入一个记忆id                     传入一个用户消息
    public Flux<String> chat(@MemoryId String memoryId,@UserMessage String message); // 返回一个Flux<String>，代表聊天结果流



}
